
#if !defined _PACKET_CONNECTION_H
#define _PACKET_CONNECTION_H

#include "RtCnPacketConnection_T.h"
#include "RtCnPacketPDU.h"

class CPacketClient :	public CPacketConnection_T<CDataPktPDU, true>
{
public:
	CPacketClient(IConnectorT *pConnector);
	virtual ~CPacketClient();

	virtual void OnConnectIndication(RtResult aReason, IRtTransport *aTrpt,IRtAcceptorConnectorId *aRequestId);
	RtResult HandshakeRequest(LINK_TYPE type);
	void CancelConnect();
protected:
	void OnTimer(CRtTimerWrapper *aId);
	virtual void OnReceiveConnectResponse(CRespPDU &responsePDU);
	virtual void OnDisconnect(RtResult aReason, IRtTransport *pTransport);
		
protected:	
	IConnectorT			*m_pConnector;
	BOOL				m_bCancelConnectFlag;
	CRtTimerWrapper	m_UDPHandShakeTimer;
	LONG				m_lUDPHandShakeInterval;
};

class CPacketServer :	public PktConnectionWithKeepAlive_T
{
public:
	CPacketServer(IRtTransport *pTransport
		//, ConnectionList_T *pConnectionList
		, IRtTransportSink* pITransportSink);
	virtual ~CPacketServer();

		
protected:
//	virtual void OnTimer(CRtTimerWrapper* aId);
	virtual void OnReceiveConnectRequest(CReqPDU &requestPDU);

		
protected:
};

#endif

